//
//  SearchResultDetailViewController.h
//  BVCMS Search
//
//  Created by Allen Thomas on 9/13/10.
//

#import <UIKit/UIKit.h>
#import "PersonDetails.h"
#import "PersonDetailsConnection.h"

@interface SearchResultDetailViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, PersonDetailsConnectionDelegate> {
	PersonDetails *person;
	IBOutlet UITableView *table;
	IBOutlet UIImageView *photo;
	IBOutlet UIImage *personImage;
	IBOutlet UILabel *nameLabel;
	IBOutlet UILabel *statusLabel;
	UIView *loadingView;
	IBOutlet UIView *headerView;
	IBOutlet UIActivityIndicatorView *imageLoad;
	
	PersonDetailsConnection *connection;
	
	BOOL isImageLoaded;
}
	 
@property (nonatomic, retain) PersonDetails *person;
@property (nonatomic, retain) UITableView *table;
@property (nonatomic, retain) UIView *headerView;
@property (nonatomic, retain) UIImageView *photo;
@property (nonatomic, retain) UILabel *nameLabel;
@property (nonatomic, retain) UILabel *statusLabel;
@property (nonatomic, retain) UIActivityIndicatorView *imageLoad;

-(void) downloadPhoto;
-(void) photoDownload_callback:(NSData *)data;
-(void) photoDownload_error_callback:(NSError *)error;

- (void)update:(PersonDetails*)selectedPerson;
- (IBAction)photoButtonPressed:(id)sender;

- (void)personDetailsCallback:(PersonDetails *)personDetails;
- (void)personDetailsFailed:(NSError *)error;

@end
